<template>
  <div>
    <el-table :data="visits">
      <el-table-column prop="date" label="日期" width="120" />
      <el-table-column prop="department" label="科室" width="120" />
      <el-table-column prop="doctor" label="医生" width="120" />
      <el-table-column label="类型" width="100">
        <template #default="{ row }">
          <el-tag :type="row.type === '挂号' ? 'info' : 'success'">{{ row.type }}</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="状态" width="100">
        <template #default="{ row }">
          <el-tag :type="row.status === '已完成' ? 'success' : row.status === '待就诊' ? 'warning' : 'info'">{{ row.status }}</el-tag>
        </template>
      </el-table-column>
      <el-table-column prop="desc" label="备注" />
    </el-table>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const visits = ref([
  { id: 1, date: '2024-05-01', department: '内科', doctor: '李医生', type: '挂号', status: '已完成', desc: '普通门诊' },
  { id: 2, date: '2024-05-10', department: '心内科', doctor: '王医生', type: '就诊', status: '已完成', desc: '高血压复诊' },
  { id: 3, date: '2024-05-15', department: '外科', doctor: '赵医生', type: '挂号', status: '待就诊', desc: '手术预约' }
])
</script> 